home *** CD-ROM | disk | FTP | other *** search
- ELF_GETSCN(3E) Last changed: 10-13-98
-
-
- NNAAMMEE
- eellff__ggeettssccnn, eellff__nnddxxssccnn, eellff__nneewwssccnn, eellff__nneexxttssccnn - Get section
- information
-
- SSYYNNOOPPSSIISS
- cccc [_f_l_a_g ...] _f_i_l_e ... --lleellff [_l_i_b_r_a_r_y ...]
-
- ##iinncclluuddee <<lliibbeellff..hh>>
-
- EEllff__SSccnn **eellff__ggeettssccnn((EEllff **eellff,, ssiizzee__tt iinnddeexx));;
-
- ssiizzee__tt eellff__nnddxxssccnn((EEllff__SSccnn **ssccnn));;
-
- EEllff__SSccnn **eellff__nneewwssccnn((EEllff **eellff));;
-
- EEllff__SSccnn **eellff__nneexxttssccnn((EEllff **eellff,, EEllff__SSccnn **ssccnn));;
-
- IIMMPPLLEEMMEENNTTAATTIIOONN
- IRIX systems
-
- DDEESSCCRRIIPPTTIIOONN
- These functions provide indexed and sequential access to the sections
- associated with the ELF descriptor, eellff. If the program is building a
- new file, it is responsible for creating the file's ELF header before
- creating sections; see eellff__ggeetteehhddrr(3E).
-
- eellff__ggeettssccnn returns a section descriptor, given an iinnddeexx into the
- file's section header table. Note the first _r_e_a_l section has index 1.
- Although a program can get a section descriptor for the section whose
- iinnddeexx is 0 (SSHHNN__UUNNDDEEFF, the undefined section), the section has no data
- and the section header is empty (though present). If the specified
- section does not exist, an error occurs, or eellff is null, eellff__ggeettssccnn
- returns a null pointer.
-
- eellff__nneewwssccnn creates a new section and appends it to the list for eellff.
- Because the SSHHNN__UUNNDDEEFF section is required and not interesting to
- applications, the library creates it automatically. Thus, the first
- call to eellff__nneewwssccnn for an ELF descriptor with no existing sections
- returns a descriptor for section 1. If an error occurs or eellff is
- null, eellff__nneewwssccnn returns a null pointer.
-
- After creating a new section descriptor, the program can use
- eellff__ggeettsshhddrr to retrieve the newly created, clean section header. The
- new section descriptor will have no associated data [see
- eellff__ggeettddaattaa(3E)]. When creating a new section in this way, the
- library updates the ee__sshhnnuumm member of the ELF header and sets the
- EELLFF__FF__DDIIRRTTYY bit for the section [see eellff__ffllaagg(3E)]. If the program is
- building a new file, it is responsible for creating the file's ELF
- header [see eellff__ggeetteehhddrr(3E)] before creating new sections.
-
- eellff__nneexxttssccnn takes an existing section descriptor, ssccnn, and returns a
- section descriptor for the next higher section. One may use a null
- ssccnn to obtain a section descriptor for the section whose index is 1
- (skipping the section whose index is SSHHNN__UUNNDDEEFF). If no further
- sections are present or an error occurs, eellff__nneexxttssccnn returns a null
- pointer.
-
- eellff__nnddxxssccnn takes an existing section descriptor, ssccnn, and returns its
- section table index. If ssccnn is null or an error occurs, eellff__nnddxxssccnn
- returns SSHHNN__UUNNDDEEFF.
-
- EEXXAAMMPPLLEESS
- The following is an example of sequential access. Each pass through
- the loop processes the next section in the file; the loop terminates
- when all sections have been processed.
-
- scn = 0;
- while ((scn = elf_nextscn(elf, scn)) != 0)
- {
- /* process section */
- }
-
- SSEEEE AALLSSOO
- eellff(3E), eellff__bbeeggiinn(3E), eellff__ffllaagg(3E), eellff__ggeettddaattaa(3E),
- eellff__ggeetteehhddrr(3E), eellff__ggeettsshhddrr(3E)
-
- This man page is available only online.
-
-